import time

import allure
from selenium.webdriver.common.by import By
from selenium.webdriver.remote.webdriver import WebDriver

from src.PO.base import Base
from src.PO.product_list_page import ProductListPage

@allure.feature("主界面")
class MainPage(Base):
    __PRODUCT_MANAGEMENT=(By.XPATH,"//*[text()='商品管理']")
    __PRODUCT_LIST=(By.XPATH,"//*[text()='商品列表']")
    # def __init__(self,driver:WebDriver):
    #     self.driver=driver

    def click_product_liist(self):
        with allure.step("跳转商品列表界面"):
            # self.driver.find_element(*self.__PRODUCT_MANAGEMENT).click()
            # self.driver.find_element(*self.__PRODUCT_LIST).click()
            self.find_and_click(*self.__PRODUCT_MANAGEMENT)
            self.find_and_click(*self.__PRODUCT_LIST)
        return ProductListPage(self.driver)

